
package com.ruoyi.busi.guide.service.impl;

import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.ruoyi.busi.guide.domain.Task;
import com.ruoyi.busi.guide.mapper.TaskMapper;
import com.ruoyi.busi.guide.service.ITaskService;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 导师任务Service业务层处理
 */
@Service
public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements ITaskService {

    private final TaskMapper taskMapper;

    public TaskServiceImpl(TaskMapper taskMapper) {
        this.taskMapper = taskMapper;
    }

    @Override
    public List<Task> selectByMentorId(Long mentorId) {
        if (mentorId == null) {
            throw new IllegalArgumentException("导师ID不能为空");
        }
        return taskMapper.selectByMentorId(mentorId);
    }

    @Override
    public List<Task> selectByStatus(String status) {
        if (status == null || status.isEmpty()) {
            throw new IllegalArgumentException("任务状态不能为空");
        }
        return taskMapper.selectByStatus(status);
    }

    @Override
    public boolean deleteTaskByIds(List<Long> taskIds) {
        return this.removeByIds(taskIds);
    }
}
